
Ext.onReady(function(){
	Ext.BLANK_IMAGE_URL = "extjs/resources/images/default/s.gif";
		  Ext.QuickTips.init();
			windowst.show();
	});



var stroedt=Ext.create('Ext.data.Store', {
		 model: 'User',
		 fields:['name', 'dizhi','bianma', 'bianma','lianxi'],
		data:{'items':[
			{ 'name': '10111',  "dizhi":"北京",  "bianma":"40016","lianxi":"李忠"  },
			{ 'name': '10112',  "dizhi":"上海",  "bianma":"68016" ,"lianxi":"朱经理"},
			{ 'name': '10113', "dizhi":"天津",  "bianma":"408973" ,"lianxi":"周总" },
			{ 'name': '10114', "dizhi":"重庆", "bianma":"404567" ,"lianxi":"刘经理" }
		]},
			proxy: {
				type: 'memory',
				reader: {
					type: 'json',
					root: 'items'
				}
			}
});



var grids=Ext.create('Ext.grid.Panel',{
 listeners:{
			containerdblclick: function(grid, e, eOpts){ //单击事件
    						grid.getStore().add({'name':'12', 'dizhi':'','bianma':'','lianxi':''});
						
					},
				
		},plugins: [
    				Ext.create('Ext.grid.plugin.CellEditing', {
        				clicksToEdit: 1
    				})
				],
columns: [
   				 { header: '预收金额',style:'padding-left:40px;margin-left:40px;', dataIndex: 'bianma' },
				 { header: '来源单别', dataIndex: 'lianxi' },
				 { header: '来源单号', dataIndex: 'lianxi'},
				 { header: '摘要',style:'padding-right:260px;', dataIndex: 'lianxi' }
					 ],
			 height: 130,
		 width:1971,
		 scroll:false, 
		 viewConfig: {
		 style: { overflow: 'auto', overflowX: 'hidden' }
		 }
		 
})

var filterPanel = Ext.create('Ext.panel.Panel', {
    bodyPadding: 6,  // 避免Panel中的子元素紧邻边框
    width: 1985,
	height:170,
    items:[grids],
	bbar:[{xtype:"textfield",disabled:true,width:90,margin:'0 8',value:'0.00'}],
});	
var  tableds=Ext.create('Ext.TabPanel',{
	width:"100%",
	height:230,
	autoScroll:false,
	bodyPadding: 5,
	items:[{title:'内容',autoScroll:false,items:[filterPanel]},{title:'备注',xtype:'textarea',name:'Remark',fieldLabel: '备注',labelWidth: 30,}],
});

var formsg=Ext.create('Ext.form.Panel', {
    bodyPadding: 5,
	height:'100%',
	layout:"column",
	baseCls:'x-plain',
	items:[{
		 xtype: 'textfield',
        name: 'SalesMan',
		bodyPadding: 5,
        fieldLabel: '所属部门',
        style:'margin-left:20px',
		width:250,
        labelWidth: 80,
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'Marker',
        fieldLabel: '制单人员',
		style:'margin-left:25px',
		width:290,
        labelWidth:90,
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'ProdDepart',
        fieldLabel: '所属项目',
        style:'margin-left:20px',
		width:250,
        labelWidth: 80,
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'Permitter',
        fieldLabel: '复核人员',
		style:'margin-left:25px',
		width:290,
        labelWidth:90,
        anchor: '100%',
			}],
	});


var forms=Ext.create('Ext.form.Panel', {
    bodyPadding: 5,
	height:'100%',
	layout:"column",
	baseCls:'x-plain',
	items:[
	{
		style:'margin-left:20px;',
		 xtype: 'textfield',
        name: 'Customer',
        fieldLabel: '客户',
		width:250,
        labelWidth: 80,
		emptyText:'请输入客户',
        anchor: '100%',
			},{
		style:'margin-left:25px;color:blue',
		 xtype: 'datefield',
        name: 'BillDate',
        format:'Y-m-d',
		value:Ext.util.Format.date(Ext.Date.add(new Date(),Ext.Date.MONTH,1),"Y-m-d"),
        fieldLabel: '单据日期',
		
		width:300,
        labelWidth:100,
        anchor: '100%',
			},{
		style:'margin-left:20px;',
		 xtype: 'textfield',
        name: 'DeliveryAddress',
        fieldLabel: '结算方式一',
		width:198,
        labelWidth: 80,
        value:'转账',
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'dizhiton',
		width:50,
        labelWidth: 70,
		margin:"0 1",
		value:'0.00',
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'BillNo',
		style:"color:blue;margin-left:25px",
        fieldLabel: '单据号码',
		width:300,
        labelWidth:100,
        anchor: '100%',
			},{
		style:'margin-left:20px;',
		 xtype: 'textfield',
        name: 'OutWareType',
        fieldLabel: '结算方式二',
        width:198,
        labelWidth: 80,
        value:'汇票',
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'dizhiton',
		width:50,
		value:'0.00',
        labelWidth: 70,
		margin:"0 1",
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'BillNo',
		style:"color:blue;margin-left:25px",
        fieldLabel: '币别',
        labelWidth:100,
		width:300,
        anchor: '100%',
			},{
				style:'margin-left:20px;',
				 xtype: 'textfield',
			        name: 'OutWareType',
				   fieldLabel: '结算方式三',
				 	width:198,
			        labelWidth: 80,
			        anchor: '100%',
						},{
					 xtype: 'textfield',
			        name: 'dizhiton',
					width:50,
					value:'0.00',
			        labelWidth: 70,
					margin:"0 1",
			        anchor: '100%',
	        },{
			style:'margin-left:25px',
		 xtype: 'textfield', //多行文本域
        name: 'huilv',
        fieldLabel: '汇率',
        labelWidth:100,
		width:300,
        anchor: '100%',
			},{
		 xtype: 'textfield',
        name: 'Ware',
        fieldLabel: '折扣率',
		width:250,
		value:'0.00',
		style:"color:blue;margin-left:20px",
        labelWidth: 80,
        anchor: '100%',
			},{
	             	fieldLabel: '应收冲款类型',
					xtype:'combo',
	             	name: 'guowaimaoyi',
					style:"margin-left:25px;",
	             	displayField: 'name',
					labelWidth:100,
					width:300,
					value:'预收款',
					store: Ext.create('Ext.data.ArrayStore', {
						 fields: ['id', 'name'],
				         data: [[1, '预收款'], [2, '预收冲应收']]
					}),
	         	},{
		style:'margin-left:20px;',
		 xtype: 'datefield',
        name: 'ProveBillNo',
        fieldLabel: '终止账月',
		width:250,
		format:'Y-m-d',
		value:Ext.util.Format.date(Ext.Date.add(new Date(),Ext.Date.MONTH,1),"Y-m-d"),
        labelWidth: 80,
        anchor: '100%',
			},{
				style:'margin-left:25px',
				 xtype: 'textfield', //多行文本域
		        name: 'huilv',
				 xtype: 'textfield',
			        name: 'ProveBillNo',
			        fieldLabel: '凭证编号',
					width:300,
			        labelWidth: 100,
			        anchor: '100%',
        	items:[{boxLabel:"复核后自动生成发票",inputValue:1,checked:true}]
			},tableds,formsg
	]
});
//winform窗口
var windowst=new  Ext.Window({
	width:640,
	height:528,
	title:"应收冲款单",
	closable:true,
	resizable:false, //设置是否可以改变大小
	draggable:true,
	anchor: '100%',
	items:[forms],
});
var windows2=new  Ext.Window({
	width:400,
	height:300,
	title:"物料选择",
	closable:true,
	resizable:false, //设置是否可以改变大小
	draggable:true,
	closeAction:"hide",
});